import axios from '@/utils/axios.js'
var pre = 'platform/admin/v1/userCenter/'
var func = [ 'getUserData', 'getUnbindingqrCode', 'getBindingqrCode', 'changePassword', 'accountSet', 'phoneSet', 'checkBinding', 'checkUnbinding', 'unbindingPhone' ]
var api = {}
func.forEach(value => {
  api[value] = pre + value
})

var getUserData = (params) => {
  return axios.get(api.getUserData, {params: params})
}

var getBindingqrCode = (params) => {
  return axios.get(api.getBindingqrCode, {params: params})
}

var getUnbindingqrCode = (params) => {
  return axios.get(api.getUnbindingqrCode, {params: params})
}

var changePassword = (params) => {
  return axios.post(api.changePassword, params)
}

var accountSet = (params) => {
  return axios.post(api.accountSet, params)
}

var phoneSet = (params) => {
  return axios.post(api.phoneSet, params)
}

var checkBinding = (params) => {
  return axios.get(api.checkBinding, {params: params})
}

var checkUnbinding = (params) => {
  return axios.get(api.checkUnbinding, {params: params})
}

var unbindingPhone = (params) => {
  return axios.post(api.unbindingPhone, params)
}

export { getUserData, getUnbindingqrCode, getBindingqrCode, changePassword, accountSet, phoneSet, checkBinding, checkUnbinding, unbindingPhone }
